package com.lzy.concertticket.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzy.concertticket.dao.mapper.ArtistMapper;
import com.lzy.concertticket.model.entity.ArtistEntity;
import com.lzy.concertticket.model.req.ArtistReq;
import com.lzy.concertticket.model.vo.ArtistVo;
import com.lzy.concertticket.service.ArtistService;
import org.springframework.stereotype.Service;

/**
* @author 30793
* @description 针对表【tb_artist(艺人信息表)】的数据库操作Service实现
* @createDate 2025-08-16 23:21:21
*/
@Service
public class ArtistDao extends ServiceImpl<ArtistMapper, ArtistEntity> {

    public ArtistEntity getByName(String name) {
        return baseMapper.getByName(name);
    }

    public ArtistVo getByIdOrName(Long id, String name) {
        return baseMapper.getByIdOrName(id, name);
    }

    public Page<ArtistVo> getPage(ArtistReq artistReq) {
        Page<ArtistVo> page = new Page<>(artistReq.getPageNum(), artistReq.getPageSize());
        return baseMapper.getPage(page, artistReq);
    }
}




